/**
 * 
 */
package com.fyfeng.android.tools.view;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.view.View;

/**
 * @author YUZHENGWEI
 * @date 2013-4-22
 * @email yzw1007@gmail.com
 * @QQ 136025011
 *
 */

public class ViewUtils {

	public static void setViewVisible(final Activity activity, final int viewId){
		View view = activity.findViewById(viewId);
		view.setVisibility(View.VISIBLE);
	}
	public static void setViewInVisible(final Activity activity, final int viewId){
		View view = activity.findViewById(viewId);
		view.setVisibility(View.INVISIBLE);
	}
	public static void setViewGone(final Activity activity, final int viewId){
		View view = activity.findViewById(viewId);
		view.setVisibility(View.GONE);
	}
	
	public static void setBackgroundResource(final Activity activity, final int viewId, final int resid){
		View view = activity.findViewById(viewId);
		view.setBackgroundResource(resid);
	}
	
	public static void setBackgroundColor(final Activity activity, final int viewId, final int resid){
		View view = activity.findViewById(viewId);
		view.setBackgroundColor(resid);
	}
	
	public static void setBackgroundDrawable(final Activity activity, final int viewId, final Drawable background){
		View view = activity.findViewById(viewId);
		view.setBackgroundDrawable(background);
	}
	
}
